<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
	
	<title>权限管理</title>
	<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
	<link th:href="@{/css/font-awesome.css}" rel="stylesheet">
	<link th:href="@{/css/animate.css}" rel="stylesheet">
	<link th:href="@{/css/style.css}" rel="stylesheet">
	<link th:href="@{/css/login.css}" rel="stylesheet">
	<!--[if lt IE 9]>
	    <meta http-equiv="refresh" content="0;ie.html" />
	    <![endif]-->
</head>

<body class="signin">
	<div class="signinpanel">
		<div class="row">
			<div class="col-sm-7">
				<div class="signin-info">
					<div class="logopanel m-b">
						<h1>权限管理</h1>
					</div>
					<div class="m-b"></div>
					<h3>
						欢迎使用<strong>权限管理系统</strong>
					</h3>
					<!-- <ul class="m-b">
						<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>
							springBoot</li>
						<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> mybatis</li>
						<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> shiro</li>
						<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>
							thymeleaf</li>
						<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>
							bootstrap</li>

					</ul> -->

				</div>
			</div>
			<div class="col-sm-5">
				<form id="signupForm">
					<h3 class="text-center">用户登录</h3>
					
					<input type="text" name="username" class="form-control uname"
						value="admin" /> 
					<input type="password" name="password"
						class="form-control pword m-b" value="123456" /> 
					<button class="btn btn-login btn-block">登录</button>
					<!--按钮模块-->
					<!-- <div class="outside-login">
						<div class="outside-login-tit">
							<span>代码链接</span>
						</div>
						<div class="outside-login-cot">
							<a class="outside-login-btn wxoa actived oschina J-btnSwitchLoginType" target="_Blank" href="https://www.oschina.net/p/bootdo"> 
								 <em><i class="fa fa-home"></i></em>       
								 <span>oschina主页</span>      
							</a>
							<a class="outside-login-btn wxoa actived my J-btnSwitchLoginType" target="_Blank" href="https://gitee.com/lcg0124/bootdo"> 
								 <em><i class="fa fa-git-square"></i></em>       
								 <span>码云仓库</span>      
							</a>
							<a class="outside-login-btn wxoa actived git J-btnSwitchLoginType" target="_Blank" href="https://github.com/lcg0124/bootdo"> 
								 <em><i class="fa fa-github"></i></em>       
								 <span>GitHub仓库</span>      
							</a>
						</div>
					</div> -->
					
				</form>
			</div>
		</div>
		<div class="signup-footer">
			<div th:replace="fragments/footer :: footer"></div>
		</div>
	</div>
	<!-- 全局js -->
	<script th:src="@{/js/jquery-2.1.1.js}"></script>
	<script th:src="@{/js/bootstrap.min.js}"></script>	

	<!-- jQuery Validation plugin javascript-->
	<script th:src="@{/js/plugins/validate/jquery.validate.min.js}"></script>
	<script th:src="@{/js/plugins/validate/messages_zh.min.js}"></script>
	<script th:src="@{/js/plugins/layer/layer.min.js}"></script>
	
	<script th:src="@{/js/axios.js}"></script>
	<script th:src="@{/js/site.js}"></script>
	
	<script type="text/javascript">
		$(document).ready(function() {
			validateRule();
			//$("#signupForm").validate();
		});
		$.validator.setDefaults({
			submitHandler : function() {
				login();
			}
		});

		function login() {
			fetch(function(res){
				if (res == "Success") {
					parent.location.href = contextPath + '/index';
				} else {
					layer.msg(res);
				}
			}, "/validateLogin", "post", $('#signupForm').serialize());
			
		}

		function validateRule() {
			var icon = "<i class='fa fa-times-circle'></i> ";
			$("#signupForm").validate({
				rules : {
					username : {
						required : true
					},
					password : {
						required : true
					}
				},
				messages : {
					username : {
						required : icon + "请输入您的用户名",
					},
					password : {
						required : icon + "请输入您的密码",
					}
				}
			})
		}
	</script>
</body>




</html>
